cmake_minimum_required(VERSION 3.31)
project(cpp)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# 启用测试
enable_testing()

# 可以加上这个提高速度
set(FETCHCONTENT_QUIET OFF)


add_executable(p0601 ch01/p0601_add_2_numbers.cpp)
add_executable(exercise0103 ch01/exercise0103.cpp)
add_executable(exercise0104 ch01/exercise0104.cpp)
add_executable(exercise0105 ch01/exercise0105.cpp)
add_executable(exercise0108 ch01/exercise0108.cpp)
add_executable(exercise0109 ch01/exercise0109.cpp)
add_executable(exercise0110 ch01/exercise0110.cpp)
add_executable(exercise0111 ch01/exercise0111.cpp)
add_executable(exercise0120 ch01/exercise0120.cpp)
add_executable(exercise0122 ch01/exercise0122.cpp)
add_executable(p1101 ch01/p1101_sum_from_1_to_10.cpp)
add_executable(p1301 ch01/p1301_sum_from_1_to_10.cpp)
add_executable(p1501 ch01/p1501_read_numbers.cpp)
add_executable(p1701 ch01/p1701_record_consecutive_numbers.cpp)
add_executable(p2101 ch01/p2101_read_sales_item.cpp)
add_executable(p2102 ch01/p2102_add_sales_item.cpp)
add_executable(p2401 ch01/p2401_record_total_items.cpp)


add_executable(ch2 ch02/ch2_exercise.cpp
        ch02/test_const.h
        ch02/test_const.cpp
)
target_link_libraries(ch2 gtest_main)
add_executable(pxxaa ch11/pxxxx_using_map.cpp)
add_executable(pxxab ch11/pxxxx_using_set.cpp)
add_executable(exercise1104 ch11/exercise1104.cpp)
add_executable(pxxac ch11/pxxxx_initialize_map_and_set.cpp)
add_executable(pxxad ch11/pxxxx_initialize_multimap_multiset.cpp)
add_executable(exercise1107 ch11/exercise1107.cpp)
add_executable(pxxae ch11/pxxxx_comparison_function.cpp)
add_executable(exercise1108 ch11/exercise1108.cpp)
add_executable(exercise1111 ch11/exercise1111.cpp)
add_executable(exercise1112 ch11/exercise1112.cpp)
add_executable(pxxaf ch11/pxxxx_iterators_for_sets_are_const.cpp)
add_executable(pxxag ch11/pxxxx_iter_map.cpp)
add_executable(pxxah ch11/pxxxx_set_insert.cpp)
add_executable(pxxai ch11/pxxxx_return_of_map_insert.cpp)
add_executable(pxxaj ch11/pxxxx_using_multimap.cpp)

add_executable(ch3 ch03/ch3_exercise.cpp)
target_link_libraries(ch3 gtest_main)

add_executable(ch4 ch04/ch4_exercise.cpp)
target_link_libraries(ch4 gtest_main)

add_executable(ch5 ch05/ch5_exercise.cpp)
target_link_libraries(ch5 gtest_main)

add_executable(ch6 ch06/ch6_exercise.cpp)
target_link_libraries(ch6 gtest_main)

add_executable(test7 ch07/test_Sales_data.cpp material/Sales_data.cpp)

add_executable(exercise0801 ch08/exercise0801.cpp)
add_executable(pxx11 ch08/pxxxx_inherit.cpp)
add_executable(pxx12 ch08/exercise0804.cpp)
add_executable(exercise0804 ch08/exercise0804.cpp)
add_executable(exercise0805 ch08/exercise0805.cpp)
add_executable(pxx13 ch08/pxxxx_istringstream.cpp)
add_executable(pxx14 ch08/pxxxx_ostringstream.cpp)

add_executable(ch9 ch09/ch9_exercise.cpp)
add_executable(exercise0914 ch09/exercise0914.cpp)
add_executable(exercise0915 ch09/exercise0915.cpp)
add_executable(exercise0916 ch09/exercise0916.cpp)
add_executable(exercise0924 ch09/exercise0924.cpp)
add_executable(pxx15 ch09/pxxxx_stack_adaptor.cpp)

add_executable(ch10
        material/Sales_data.cpp)
add_executable(px10 ch10/pxx10_find.cpp)
add_executable(exercise1001 ch10/exercise1001.cpp)
add_executable(exercise1002 ch10/exercise1002.cpp)
add_executable(exercise1003 ch10/exercise1003.cpp)
add_executable(exercise1004 ch10/exercise1004.cpp)
add_executable(exercise1005 ch10/exercise1005.cpp)
add_executable(exercise1009 ch10/exercise1009.cpp material/Utils.cpp)
add_executable(exercise1011 ch10/exercise1011.cpp material/Utils.cpp)
add_executable(exercise1012 ch10/exercise1012.cpp material/Utils.cpp material/Sales_data.cpp)
add_executable(exercise1013 ch10/exercise1013.cpp material/Utils.cpp)
add_executable(exercise1014 ch10/exercise1014.cpp)
add_executable(exercise1015 ch10/exercise1015.cpp)
add_executable(exercise1016 ch10/exercise1016.cpp)
add_executable(exercise1017 ch10/exercise1017.cpp material/Utils.cpp material/Sales_data.cpp)
add_executable(exercise1018 ch10/exercise1018.cpp material/Sales_data.cpp)
add_executable(exercise1020 ch10/exercise1020.cpp material/Utils.cpp)
add_executable(exercise1022 ch10/exercise1022.cpp material/Utils.cpp)
add_executable(exercise1024 ch10/exercise1024.cpp material/Utils.cpp)

add_executable(pxxxmap ch11/pxxxx_unordered_map.cpp)


add_executable(exercise1201 ch12/exercise1201.cpp material/StrBlob.cpp)
add_executable(ch12 ch12/ch12_exercise.cpp
        material/StrBlob.h
        material/StrBlob.cpp)
add_executable(exercise1206 ch12/exercise1206.cpp)
add_executable(exercise1207 ch12/exercise1207.cpp)
add_executable(exercise1214 ch12/exercise1214.cpp)
add_executable(exercise1215 ch12/exercise1215.cpp)
add_executable(exercise1216 ch12/exercise1216.cpp)
add_executable(exercise1220 ch12/exercise1220.cpp material/StrBlob.cpp material/StrBlobPtr.cpp)
add_executable(runQueries ch12/runQueries.cpp material/QueryResult.cpp material/TextQuery.cpp)

add_executable(test_StrVec ch13/test_StrVec.cpp material/StrVec.cpp)
add_executable(test_Message_Folder ch13/test_Message_Folder.cpp material/Folder.cpp material/Message.cpp)

add_executable(exercise1426 ch14/exercise1426.cpp material/StrVec.cpp material/StrBlob.cpp)
add_executable(exercise1427 ch14/exercise1427.cpp material/StrBlob.cpp material/StrBlobPtr.cpp)

add_executable(exercise1503 ch15/exercise1503.cpp material/Quote.cpp)
add_executable(exercise1505 ch15/exercise1505.cpp material/Quote.cpp material/BulkQuote.cpp)
add_executable(exercise1506 ch15/exercise1506.cpp material/Quote.cpp material/BulkQuote.cpp)
add_executable(exercise1507 ch15/exercise1507.cpp material/Quote.cpp material/LimitQuote.cpp)
add_executable(p602_conversion_from_base_to_derived ch15/p602_conversion_from_base_to_derived.cpp material/Quote.cpp material/BulkQuote.cpp)
add_executable(exercise1511 ch15/exercise1511.cpp material/Quote.cpp material/BulkQuote.cpp)



add_executable(pxxxx_compare ch16/pxxx_compare_template.cpp)
add_executable(pxxx_strcmp_template ch16/pxxx_strcmp_template.cpp)
add_executable(test1 test/test.cpp)

